import time
def demo(func):
    def wrapps(*args,**kwargs):
        st=time.time()
        res=func(*args,**kwargs)
        print("执行时间为：",time.time()-st)
        return res

    return wrapps


@demo
def demo1():
    time.sleep(1)

# @demo
def demo2(a,b):
    s=a+b
    time.sleep(1)
    return s

@demo
def demo3():
    time.sleep(0.5)

if __name__ == '__main__':
    demo1()
    res=demo2(1,2)
    # print(res)
    # demo3()